<?php
pc_base::load_app_class('hchbase','hchindex',0);
class index extends hchbase {
	function __construct() {
		parent::__construct();
		$this->menuList = array(
			'service'=>array('name'=>'企业服务','url'=>'/index.php?m=hchservice&c=index&a=init&action=service','index'=>'service'),
			'science'=>array('name'=>'科技园区','url'=>'/index.php?m=hchservice&c=index&a=init&action=science','index'=>'science'),
			'train'=>array('name'=>'培训咨询','url'=>'/index.php?m=hchservice&c=index&a=train','index'=>'train'),
			'e_commerce'=>array('name'=>'电商平台','url'=>'/index.php?m=hchservice&c=index&a=init&action=e_commerce','index'=>'e_commerce'),
			'information'=>array('name'=>'信息化服务','url'=>'/index.php?m=hchservice&c=index&a=init&action=information','index'=>'information'),
		);
		
		$this->bulletInfo0 = '华创俱乐部 HCCLUB';
		$this->bulletInfo1 = '企业服务';
	}

	function init(){
        $action = $_GET['action']?$_GET['action']:'service';
        $this->bulletInfo2 = $this->menuList[$action]['name'];
        $curURL = $this->menuList[$action]['url'];
        
        $whereSql = " parent=14 AND name='".$action."'";
		$type = $this->dbType->get_one($whereSql,'id,show_name');
		$typeId = $type['id'];
		$whereSql = array('assort_type_id'=>$typeId,'is_del'=>0);
		$info = $this->db->get_one($whereSql,'*');
		$infoId = $info['id'];
		$browse = $info['browse_times'];
		$isBrowse = true;
		$info['content'] = htmlspecialchars_decode($info['content']);
		
		include template ( 'common', '_item' );
	}
	
	function train(){
		$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
		$subId = $_GET['sub_id']?$_GET['sub_id']:0;
        $action = $_GET['action']?$_GET['action']:'train';
        $this->bulletInfo2 = $this->menuList[$action]['name'];
        $curURL = $this->menuList[$action]['url'];
        
        if($subId==0){
	        $whereSql = " parent=14 AND name='".$action."'";
			$type = $this->dbType->get_one($whereSql,'id');
			$typeId = $type['id'];
			$whereSql = array('assort_type_id'=>$typeId,'is_del'=>0);
	        $orderSql = " id DESC";
	        $lists = $this->db->listinfo($whereSql,$orderSql,$page,10);
			$pages = $this->db->pages;
        	 
			include template ( 'common', 'page_list' );
        }else{
        	$whereSql = array('id'=>$subId);
        	$info = $this->db->get_one($whereSql,'*');
        	$infoId = $info['id'];
			$browse = $info['browse_times'];
			$isBrowse = true;
			$info['content'] = htmlspecialchars_decode($info['content']);
				
        	include template ( 'common', '_item' );
        }
	}
}
?>